﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebApplication1.Controllers
{

    /// <summary>
    /// CSS样式学习
    /// </summary>
    public class CSSController : Controller
    {
        // GET: CSS
        public ActionResult Index()
        {
            return View();
        }
        [AllowAnonymous]
        public ActionResult Login(string name, string pwd)
        {

            if (name == "admin" && pwd == "123")
            {
                ViewBag.success = true;
                //原生      jsonp
                //var callback = Request["callback"];
                // System.Web.Script.Serialization.JavaScriptSerializer s = new System.Web.Script.Serialization.JavaScriptSerializer();
                // var p = s.Serialize(new { suc = "12" });
                //return Content(callback + "(" + p + ")"); 

                //iframe+window.name
                var info = @"<script type = 'text/javascript'>"
                    + "var person = {name: 'wayne zhu',age: 22,school: 'xjtu'};"
                    +"window.name = JSON.stringify(person); "
                    + "</script>";
                return Content(info);
            }
            return View();
        }
    }
}